package com.front.web.lvyouXcxWeb;

import com.bootdo.common.utils.DateUtils;
import com.bootdo.common.utils.R;
import com.bootdo.haojiangboutils.MapBuild;
import com.bootdo.haojiangboutils.ResultReBuild;
import com.bootdo.lvyou.domain.*;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RequestMapping("/f/scenic/spot/marker/v1/")
@RestController
public class ScenicSpotMarkerControllerV1 extends LvyouSupperController{

    /**
     * http://127.0.0.1:8090/f/scenic/spot/marker/v1/get_scenic_route_list?spotId=2
     * @param spotId
     * @param request
     * @param response
     * @return
     */
    @RequestMapping("get_scenic_route_list")
    public R getScenicRouteList(
            @RequestParam(required = true,defaultValue = "-1",name = "spotId") Long spotId,
            HttpServletRequest request, HttpServletResponse response){
       // LvyouScenicRouteController
        List<LvyouScenicRoute> list  = lvyouScenicRouteService
                .list(MapBuild.getInstand().setKV("spotId",spotId));
        return R.ok().put("list", list);
    }



    /**
     * http://127.0.0.1:8090/f/scenic/spot/marker/v1/get_scenic_marker_list?refId=2&type=1
     * @param request
     * @param response
     * @return
     */
    @RequestMapping("get_scenic_marker_list")
    public R getScenicMarkerList(
            LvyouScenicMarker lvyouScenicMarker,
            HttpServletRequest request, HttpServletResponse response){
        // LvyouScenicRouteController
        // 1线 2是点 1和2传入的是路线的Id  2以后传入的是 景点Id      3景观  4卫生间  5  '警卫室' 6 '广播' 7. '出入口' 8'餐饮' 9 '商店' 10 '咨询' 11 '其他'
        List<LvyouScenicMarker> list =  lvyouScenicMarkerService
                .list(MapBuild.getInstand().setKV("type",lvyouScenicMarker.getType())
                .setKV("refId", lvyouScenicMarker.getRefId())
                );
        return R.ok().put("list", list);
    }

}
